package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

@TableName("t_product")
public class ProductBean {
    /**
     * 商品ID
     */
    @TableId(value = "pk_productId",type = IdType.AUTO)
    private Integer id;
    /**
     * 商品名
     */
    @TableField("p_name")
    private String name;

    /**
     * 商品单价
     */

    @TableField("p_price")
    private Integer price;

    /**
     * 商品产地
     */
    @TableField("p_area")
    private String area;

    /**
     * 生产日期
     */
    @TableField("p_createDate")
    private LocalDate createDate = LocalDate.now();

    /**
     * 商品销售量
     */
    @TableField(exist = false)
    private Integer sealNum;


    /**
     * 商品图片路径
     */
    @TableField("p_imgPath")
    private String imgPath;

    public ProductBean() {
    }



    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public LocalDate getCreateDate() {
        return createDate;
    }

    public void setCreateDate(LocalDate createDate) {
        this.createDate = createDate;
    }

    public Integer getSealNum() {
        return sealNum;
    }

    public void setSealNum(Integer sealNum) {
        this.sealNum = sealNum;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    @Override
    public String toString() {
        return "ProductBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", area='" + area + '\'' +
                ", createDate=" + createDate +
                ", sealNum=" + sealNum +
                ", IMGPath='" + imgPath + '\'' +
                "}\n";
    }
}
